#ifndef __GLOBAL_DATA_H__
#define __GLOBAL_DATA_H__

#include <interface/log_interface.h>
#include <interface/out_param_interface.h>
#include <interface/interface.h>
#include "buddy_group_mgr_impl.h"
#include "buddy_mgr_impl.h"
#include "user_mgr_impl.h"
#include "tribe_mgr_impl.h"
#include "cfg_mgr_impl.h"
#include "enterprise_mgr_impl.h"
#include "res_str_mgr.h"
#include "global_data_impl.h"
#include "recent_chat_mgr_impl.h"
#include "user_lst_mgr_impl.h"
#include "user_auth_mgr_impl.h"
#include <map>

class dll_object : public virtual aot::tt::idll
{
public:
	dll_object();
	virtual ~dll_object();
public:
	virtual bool query_interface(void** out, const char* key);
	virtual bool query_interface_by_iid(void** out, int key);
	virtual const char* interface_name(){return "idll.global_data.dll";}
public:
	virtual const char* module_name(){return "global_data.dll";}
	virtual bool on_regist(aot::tt::idll::dll_regist_param_t* p, aot::tt::result_t* ret = NULL);
protected:
	void init_log(aot::tt::imain* imain_obj);
public:
    bool query_interface_from_global_data_dll(void** out, const char* key);
	bool query_interface_from_data_op_dll(void** out, const char* key);
    bool query_interface_by_iid_from_data_op_dll(void** out, int key);
	bool query_interface_from_db_dll(void** out, const char* key);
public:
	aot::glb::user_mgr_helper m_user_mgr_helper;
	aot::glb::buddy_mgr_impl*  buddy_mgr_;
    aot::glb::buddy_group_mgr_impl* buddy_group_mgr_; 
	 aot::glb::online_notify_mgr_impl* online_notify_mgr_;
	aot::glb::user_mgr_impl*   user_mgr_;
	aot::glb::tribe_mgr_impl*  tribe_mgr_;
	aot::glb::cfg_mgr_impl*    cfg_mgr_;
    aot::glb::enterprise_impl* ent_mgr_;
	aot::tt::imain* main_obj;
	global_res_string_mgr* res_string_mgr_;
    aot::glb::tata_op_impl* obj_factory_;
    aot::glb::recent_chat_mgr_impl* recent_chat_mgr_;

	aot::tt::iobj_auto_ptr<aot::tt::idll> dataop_dll_;
	aot::tt::iobj_auto_ptr<aot::tt::idll> db_dll_;

	aot::glb::user_status_mgr_impl* user_status_mgr_;
	aot::glb::user_lst_mgr_impl* user_lst_mgr_;
	aot::glb::user_auth_mgr_impl* user_auth_mgr_;
};


extern dll_object* g_dll_obj;



#endif /* __GLOBAL_DATA_H__ */